#if !defined BOOK_H
#define BOOK_H

#include <iostream>
using namespace std;

class Book{
public:
	Book(string number="",string name="",string type="",string author="",string publish="",string pub_time="",float price=0,bool onshelf=true,int total_count=0);
	virtual ~Book();
	string getNum();
    void setNum(string number);
    string getName();
    void setName(string name);
    string getType();
    void setType(string type);
    string getAuthor();
    void setAuthor(string author);
	string getPublish();
    void setPublish(string publish);
    string getPubTime();
    void setPubTime(string pub_time);
	float getPrice();
    void setPrice(float price);
    bool getOnShelf();
	int getTotalCount();
    void setTotalCount(int total_count);
    bool getBookOnShelf();
	void setBookOnShelf(bool onshelf);
    void BookShow();

	void readFromFile(fstream &);
	void writeToFile(fstream &) const;
	friend istream& operator>>(istream &istrm, Book &book);
	friend ostream& operator<<(ostream &ostrm,const Book &book);
private:
	string bookNum;
    string bookName;
	string bookType;
    string bookAuthor;
    string bookPublish;
    string bookPubTime;
	float bookPrice;
	bool bookOnShelf;
	int totalCount;
};
#endif
